<template>
  <div class="app-container">
    <ht-search-form
      v-show="showSearch"
      :dictMap="dictMap"
      :queryParams="queryParams"
      :outputQueryParams="queryParams"
      :formOptions="formOptions"
      :advOptions="[]"
      defaultEventKey="entryTable"
      :labelWidth="80"
    ></ht-search-form>
    <ht-table
      ref="dataTable"
      :showSerialNumber="false"
      :multi-select="false"
      :dictMap="dictMap"
      :reqConfig="reqConfig"
      :queryParams="queryParams"
      :tableBindColumns="tableBindColumns"
      defaultEventKey="entryTable"
    >
      <template v-slot:operate>
        <el-table-column label="操作" align="center" width="200" fixed="right" class-name="small-padding fixed-width">
          <template slot-scope="scope">
            <ht-button-group
              :buttonList="[
                {
                  label: '明细',
                  // permission: 'user:xxx:xxx',
                  doFunc: () => {
                    handleAction('view', scope.row);
                  },
                },
              ]"
            />
          </template>
        </el-table-column>
      </template>
    </ht-table>
    <edit-info-dialog
      ref="editInfoDialog"
      :dictMap="dictMap"
      :form="form"
      @editComplete="editComplete"
    ></edit-info-dialog>
  </div>
</template>
<script>
import { apiUrlConfig } from "@/api/cnaps/tips/FeeItemManage/FeeTransactionDetail";
import { listPageMixin } from "@/libs/listPageMixin";
import EditInfoDialog from "./components/FeeTransactionDetailDialog";
export default {
  name: "FeeManageQuery",
  mixins: [listPageMixin],
  components: { EditInfoDialog },
  data() {
    return {
      reqConfig: apiUrlConfig,
      //数据字典
      searchFormDictList: [
        "FEE_TRANS_DETAIL_STATUS",
      ],
      showSearch: true,
      // 查询参数
      queryParams: {
        entryId: "",
        recordDate1: "",
        recordDate2: "",
        status: "",
      },
      form: {},
      formOptions: [],
      tableBindColumns: [
        { label: `记账记录ID`, prop: "entryId", align: "center" },
        { label: `记录日期`, prop: "recordDate", align: "center" },
        { label: `记账状态`, prop: "status", align: "center",dictCode:"FEE_TRANS_DETAIL_STATUS" },
      ],
    };
  },
  mounted() {
    this.formOptions = [
      {
        type: "input",
        prop: "entryId",
        defaultAttr: {
          label: "记账记录ID",
          placeholder: "记账记录ID",
        },
      },
      {
        type: "dates",
        nameObj: {
          startTimeName: "recordDate1",
          endTimeName: "recordDate2",
        },
        defaultAttr: {
          label: "记录日期",
          placeholder: ["请输入开始日期", "请输入结束日期"],
          format: "yyyy-MM-dd",
          valueFormat: "yyyyMMdd",
        },
      },
      {
        type: "dict",
        dict: "FEE_TRANS_DETAIL_STATUS",
        prop: "status",
        defaultAttr: {
          size: "small",
          label: "记账状态",
          placeholder: "记账状态",
        },
      },
    ];
  },
  methods: {
    handleAction(type, row) {
      switch (type) {
        case "view":
            this.form = row;
            this.form.isQuery = true;
            this.form.title = "手续费交易流水查询明细";
            this.$refs.editInfoDialog.show();
          break;
      }
    },
  },
};
</script>
